package com.wendal.java.happydog.bean;

import java.io.File;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

import org.apache.commons.io.FileUtils;


public class PetBean extends AbstractBean{
	protected String head_url;
	protected String maxforce;
	protected String charmprogress;
	protected String birth;
	protected String sex;
	protected String charmlevel;
	protected String heartdesc;
	protected String lv;
	protected String genus;
	protected String type;
	protected String intro;
	protected String id;
	protected String charm;
	protected String name;
	protected String heartlevel;
	protected String force;
	protected String hungry;
	protected String forceprogress;
	protected String lvprogress;

	public PetBean(JSONObject jsonObject){
		super(jsonObject);
	}
	
	
	public static void main(String[] args) throws Throwable {
		String data = FileUtils.readFileToString(new File(""));
		JSONObject object = JSONObject.fromObject(data);
		for (Object ooo : object.getJSONObject("curUser").names()) {
			System.out.println("protected String "+ooo +";");
		}
		System.out.println("---------------------------------------");
		JSONArray myPets = object.getJSONArray("myPets");
		for (Object pet : myPets) {
			System.out.println(pet);
			JSONObject info = (JSONObject) pet;
			for (Object info_name : info.names()) {
				System.out.println("protected String "+info_name +";");
			}
			System.out.println(new PetBean(info));
		}
	}
	
	/* Getter for Json*/

	public String getHead_url() {
		return jsonObject.getString("head_url");
	}

	public String getMaxforce() {
		return jsonObject.getString("maxforce");
	}

	public String getCharmprogress() {
		return jsonObject.getString("charmprogress");
	}

	public String getBirth() {
		return jsonObject.getString("birth");
	}

	public String getSex() {
		return jsonObject.getString("sex");
	}

	public String getCharmlevel() {
		return jsonObject.getString("charmlevel");
	}

	public String getHeartdesc() {
		return jsonObject.getString("heartdesc");
	}

	public String getLv() {
		return jsonObject.getString("lv");
	}

	public String getGenus() {
		return jsonObject.getString("genus");
	}

	public String getType() {
		return jsonObject.getString("type");
	}

	public String getIntro() {
		return jsonObject.getString("intro");
	}

	public String getId() {
		return jsonObject.getString("id");
	}

	public String getCharm() {
		return jsonObject.getString("charm");
	}

	public String getName() {
		return jsonObject.getString("name");
	}

	public String getHeartlevel() {
		return jsonObject.getString("heartlevel");
	}

	public String getForce() {
		return jsonObject.getString("force");
	}

	public String getHungry() {
		return jsonObject.getString("hungry");
	}

	public String getForceprogress() {
		return jsonObject.getString("forceprogress");
	}

	public String getLvprogress() {
		return jsonObject.getString("lvprogress");
	}

	
}
